#include <cstring>
#include "iostream"
#include "neoString/CString.h"

using namespace std;

int main() {
//    strcpy(p, "ac");
//    cout << p << endl;

    int n, i, j;
    while (cin >> n) {
        CString *c = new CString[n + 2];
        for (i = 0; i < n; i++) {
            cin >> c[i];
        }
        for (i = 0; i < n - 1; i++) {
            for (j = 0; j < n - i - 1; j++) {
                if (c[j] > c[j + 1]) {
                    c[n] = c[j];
                    c[j] = c[j + 1];
                    c[j + 1] = c[n];
                }
            }
        }
        for (i = 0; i < n; i++) {
            c[n + 1] += c[i];
        }
        cout << c[n + 1] << endl;
        delete[] c;
    }
    return 0;
}